Skip to content

Resolve compile error #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2015
Merged

Resolve compile error #12

merged 1 commit into from
Mar 2, 2015

Conversation

timhall
Copy link
Member

@timhall timhall commented Feb 21, 2015

The Win32 compiler directive evaluates as True for 64-bit and 32-bit Excel so the Win64 check needs to come before Win32.

Fixes #11

@timhall
Copy link
Member Author

timhall commented Mar 2, 2015

@timhall
Copy link
Member Author

timhall commented Mar 2, 2015

Reference for the difference between VBA7 and Win64 flags:

To ensure backward compatibility with previous versions of Microsoft Office, you use the VBA7 constant (this is the more typical case) to prevent 64-bit code from being used in the earlier version of Microsoft Office. For code that is different between the 32-bit version and the 64-bit version, such as calling a math API which uses LongLong for its 64-bit version and Long for its 32-bit version, you use the Win64 constant. The following code demonstrates the use of these two constants.

To summarize, if you write 64-bit code and intend to use it in previous versions of Microsoft Office, you will want to use the VBA7 conditional compilation constant. However, if you write 32-bit code in Office 2010, that code works as is in previous versions of Microsoft Office without the need for the compilation constant. If you want to ensure that you are using 32-bit statements for 32-bit versions and 64-bit statements for 64-bit versions, your best option is to use the Win64 conditional compilation constant.

- Update VBA-UTC to v1.0.1
- 64-bit declarations were being skipped and the PtrSafe warning was being
thrown on 64-bit systems. Reverse order of compiler directives so that
64-bit (now using VBA7) is reached first, since Win32 is valid for both
32- and 64-bit systems.
timhall added a commit that referenced this pull request Mar 2, 2015
@timhall timhall merged commit f10e554 into master Mar 2, 2015
@timhall timhall deleted the compile-error branch March 2, 2015 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getting compile error on 64-bit
1 participant